package net.zjitc.utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * 2 * @Author: 洪瑶
 * 3 * @Date: 2018/10/18 15:53
 * 4
 */
public class C3P0Utils {
    public static DataSource dataSource = null;
    static {
        ComboPooledDataSource com = new ComboPooledDataSource();
        dataSource = com;
    }
    public static Connection getConnection() throws SQLException {
        return dataSource.getConnection();
    }
    public static DataSource getDataSource(){
        return dataSource;
    }
}
